package com.iut.sujet1.metier;

import java.util.ArrayList;


public class CarnetV2 {

	private ArrayList<Personne> tab; 



	public CarnetV2() {
		super();
		setTab(new ArrayList<Personne>());
	}

	public CarnetV2(ArrayList<Personne> tab) {
		super();
		setTab(tab);
	}





	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((tab == null) ? 0 : tab.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof CarnetV2)) {
			return false;
		}
		CarnetV2 other = (CarnetV2) obj;
		if (tab == null) {
			if (other.tab != null) {
				return false;
			}
		} else if (!tab.equals(other.tab)) {
			return false;
		}
		return true;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		
		
		return "CarnetV2\n " + tab;
	}

	/**
	 * @return the tab
	 */
	public ArrayList<Personne> getTab() {
		return tab;
	}

	/**
	 * @param tab the tab to set
	 */
	public void setTab(ArrayList<Personne> tab) {
		this.tab = tab;
	}



	
	
}
